<div id="breadcrumb">
<a onclick="javascript:history.go(-1);" class="go-to-home tip-bottom font font18" style="cursor: pointer;">
<i class="icon-arrow-left"></i> 返回 &nbsp;
</a> 
<a onclick="javascript:history.go(-1);" class="font font18" style="cursor: pointer;"> &nbsp;&nbsp;<span>代理 &gt</span></a>
<a onclick="javascript:history.go(-1);" class="font font18" style="cursor: pointer;"> <span>创建申请&gt</span></a>
<a href="#" class="current font font18"> <span>申请详情</span></a>
</div>

<!--sidebar-menu-->
<div id="applyinfo_sidebar" class="clearfix">
  <div class="user-info">
    <img alt="" src="{{applyInfo['avatar']}}">
    
    <p>
    <span class="font font20 cr-dpe">{{applyInfo['nickName']}}</span>
    </p>
    <p>
    <span class="font font20 cr-dpe">{{applyInfo['uid']}}</span>
    </p>
  </div>
  <div class="progtrckr-box">
    <div class="progtrckrline" ></div>

    <div class="p-anchorinfo">
    <div class="l-row">
       <span class="lable font font16 cr-b9">主播等级:</span>
       <span class="font font16">{{applyInfo['level2']}}</span>
    </div>

    <div class="l-row">
       <span class="lable font font16 cr-b9">真实姓名:</span>
       <span class="font font16">{{applyInfo['realName']}}</span>
    </div>

    <div class="l-row">
       <span class="lable font font16 cr-b9">联系电话:</span>
       <span class="font font16">{{applyInfo['telephone']}}</span>
    </div>

    <!--  <div class="l-row">
       <span class="lable font font16 cr-b9">总播出时长:</span>
       <span class="font font16">2小时41分钟</span>
    </div>  -->
  </div>

  <div style=" margin-top:30px;">
    <a href="/anchor/anchorinfo?uid={{applyInfo['uid']}}" class="btn btn-purple" style="width:210px;" >查看主播详细资料</a>
  </div>

</div>

</div>
<!--end sidebar-menu-->

<div id="applyinfo_content">
  <div class="container-fluid">
       <div class="row-fluid" style="margin-top: 40px;">
         <div class="content-box" style="background: #FFF; text-align: left;  padding-bottom: 40px;">
          
          <div class="" style="margin:10px 10px 0 10px;">
            <span class="apply-line font font18 cr-b9">家族创建申请</span>
            <span class="font font18 cr-b9 pull-right">{{applyInfo['createTime']}}</span>
            <div class="hr-d7" style="margin: 3px 0px 0 0px;"></div>
          </div>

          <div class="ct-anchorinfo" >
            <div class="l-row">
              <span class="lable font font16 cr-b9">家族名称:</span>
              <span class="font font16">{{ applyInfo['name']}}</span>
            </div>
            
            <div class="l-row">
              <span class="lable font font16 cr-b9">家族徽章:</span>
              <span class="font font16">{{applyInfo['shortName']}}</span>
            </div>
            
            <div class="l-row" style="height: 107px; position: relative;">
              <span class="lable font font16 cr-b9" style="position:absolute; margin-top: 40px">家族图标:</span>
              <div style="position: relative;">
                <div class="photo groupimg clearfix">
                  <img alt="" src="{{applyInfo['logo']}}">                 
                </div>
              </div>
            </div>
            
            <div class="l-row">
              <span class="lable font font16 cr-b9">代理公司名称:</span>
              <span class="font font16">{{applyInfo['companyName']}}</span>
            </div>
            
            <div class="l-row">
              <span class="lable font font16 cr-b9">代理公司地址:</span>
              <span class="font font16">{{ applyInfo['address']}}</span>
            </div>
            <input type="hidden" id="uid" name="uid" value ="{{applyInfo['uid']}}" />
            <input type="hidden" id="applyId" name="id" value ="{{applyInfo['id']}}" />
            
            {% if applyInfo['applyStatus']==0%}<!--申请中-->
            <div class="l-row" style="height: 107px; position: relative; text-align: center;">
              <button onclick="applyClick('1')" class="btn btn-purple" style="margin-right:10px;" >同意</button>
              <button onclick="gRefuseClick('3')" class="btn btn-grey" >拒绝</button>
            </div>
             {% endif %} 
            
          </div>

                  {% if applyInfo['applyStatus']==1 or applyInfo['applyStatus']==2 %}<!--申请已通过、或已拒绝-->
             <div class="" style="margin:10px 10px 0 10px;">
                 <span class="apply-line font font18 cr-b9">审核记录</span>
                 <!--<span class="font font18 cr-b9 pull-right">{{info['createTime']}}</span>-->
                 <div class="hr-d7" style="margin: 3px 0px 0 0px;"></div>
             </div>
            
             <div id="applyRturn">
                 <table class="table">
                     <tr>
                         <td class="cr-b9"  style="width: 100px; text-align: right;"> 审核人： </td>
                         <td style="width: 200px; text-align: left;"> {{applyInfo['auditUser']}} </td>
                         <td class="cr-b9"  style="width: 100px; text-align: right;"> 审核时间： </td>
                         <td  style="text-align: left;" > {{applyInfo['auditTime']}} </td>
                     </tr>

                     <tr>
                         <td class="cr-b9" style="width: 100px; text-align: right;"> 审核结果： </td>
                         <td style="width: 200px; text-align: left;"> {%if applyInfo['applyStatus']==1%}同意通过{% endif %} {%if applyInfo['applyStatus']==2%}拒绝{% endif %} </td>
                         <td></td>
                         <td></td>
                     </tr>
                 </table>
             </div>
              {% endif %} 
          
         </div>
       </div>
       
  </div>
</div>
<div id="gRefuseClick" style="display:none;font-size: 16px;color: #9ea3a0;">
    <form id="gpDialogForm2">
        <div style="margin-top: 30px;"><span>请填写拒绝的理由:</span></div>
        <div><textarea id="reason" rows="5" style="width: 98%;margin-top: 10px;"></textarea></div>


    </form>
</div>

<script type="text/javascript">
  
  $(function(){
    $('body').addClass('anchorinfo');
  });

  function applyClick(status){
      var data={};
       data.type=2;
      data.applyId=document.getElementById('applyId').value;
      data.uid=document.getElementById('uid').value;
      data.status=status;

     $.ajax({
        type:"post",
        data:data,
        url:'/ajax/auditApply',
        dataType:'json',
        success:function(res){
          location.reload();
        }
      });
  }
  function gRefuseClick(){

      $('#gRefuseClick').dialog({
          autoOpen:true,
          width:500,
          height:350,
          title:'拒绝申请',
          resizable:false,
          modal:true,
          open:function(){
          },
          buttons: {
              "确定": function () {
                  var b=$('#reason').val();
                  var data={};
                  data.type=2;
                  data.applyId=document.getElementById('applyId').value;
                  data.uid=document.getElementById('uid').value;
                  data.status=3;
                  data.reason=b;

                  $.ajax({
                      type:"post",
                      data:data,
                      url:'/ajax/auditApply',
                      dataType:'json',
                      success:function(res){
                          location.reload();
                      }
                  });

              }/*,
               "取消": function () {


               }*/
          }
      });
  }
</script>